from django.db import models
from django.contrib.auth.models import AbstractUser


class Role(models.IntegerChoices):
    ROLE_DEV = 1, "开发"
    ROLE_TEST = 2, "测试"
    ROLE_VIEW = 3, "观察"


class User(AbstractUser):
    class Meta(AbstractUser.Meta):
        swappable = 'AUTH_USER_MODEL'

    role = models.SmallIntegerField(
        verbose_name="角色 1:开发、2:测试、3:观察", choices=Role.choices, blank=True, null=True)
    realName = models.CharField(
        verbose_name="姓名", max_length=4, blank=True, null=True)
